<template>
  <div>
      <GalleryInfo :gallaytype="gallaytype"/>
  </div>
</template>

<script>
import GalleryInfo from '../components/Gallery/GalleryInfo.vue'



export default {
  components: { GalleryInfo },
  data() {
    return {
      gallaytype: "",
    };
  },
  watch: {
    //监听路由是否变化
    '$route' (to, from) { 
      if(to.query.type != from.query.type){
        this.init();
        console.log(this.gallaytype);
      }
    }
  },
  created() {
    this.init();
  },
  methods: {
    init() {
      this.gallaytype = this.$route.query.type;
    },
  },
}
</script>

<style>

</style>
